package com.yami.shop.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yami.shop.bean.app.dto.CouponDto;
import com.yami.shop.bean.model.Coupon;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CouponMapper extends BaseMapper<Coupon> {
    List<CouponDto> getCouponByShopId(@Param("shopId") Long shopId,@Param("userId") String userId,@Param("couponKind") Integer couponKind);

    List<CouponDto> getCouponByShopIdAndprodId(@Param("shopId") Long shopId,@Param("userId") String userId,@Param("couponKind") Integer couponKind,@Param("prodId") Long prodId);

    IPage<CouponDto> pageByProdId(Page<CouponDto> page, @Param("coupon") Coupon coupon);

    List<CouponDto> getAllCoupon(@Param("shopId") Long shopId,@Param("prodId") Long prodId,@Param("userId") String userId,@Param("couponKind") int couponKind);

    IPage<CouponDto> couponUseByProdId(Page<CouponDto> page, @Param("coupon") Coupon coupon);

    List<CouponDto> getCoupon(@Param("userId")String userId);

    List<Coupon> getAvailableCoupon();

    List<Coupon> getUnUsedCoupon(@Param("userId")String userId);

    List<Coupon> getUsedCoupon(@Param("userId")String userId);

    List<Coupon> getOverdueCoupon(@Param("userId")String userId);

}
